{include file="Public:header" /}
<link rel="stylesheet" href="__PUBLIC__/Admin/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" media="screen"/>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>修改申请信息</h5>
                    <div class="ibox-tools" style="margin-top: -6px;">
                        <button onclick="history.go(-1);" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</button>
                    </div>
                </div>
                <div class="ibox-content">
                    <form enctype="multipart/form-data" action="__URL__/proposerEdit" method="post" id="defaultForm" class="form-horizontal">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">单位名称</label>
                            <div class="col-sm-6">
                                <input type="text" value="{$data['facilitator_name']}" name="facilitator_name" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">电话</label>
                            <div class="col-sm-6">
                                <input type="text" name="mobile" class="form-control" value="{$data['mobile']}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">邮箱</label>
                            <div class="col-sm-6">
                                <input type="text" name="email" class="form-control" value="{$data['email']}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">地址</label>
                            <div class="col-sm-6">
                                <input type="text" value="{$data['address']}" name="address" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <!--详情start-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">申请类型</label>
                            <div class="col-sm-6 i-check" style="line-height: 30px;">
                                <input type="radio" name="type" value="1" <?php if($data['type'] == '1') echo 'checked="checked"'; ?> >&nbsp;基地服务商&nbsp;
                                <input type="radio" name="type" value="2" <?php if($data['type'] == '2') echo 'checked="checked"'; ?> >&nbsp;酒店服务商&nbsp;
                                <input type="radio" name="type" value="3" <?php if($data['type'] == '3') echo 'checked="checked"'; ?> >&nbsp;交通服务商&nbsp;
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group"  id="trial_status_group">
                            <label class="col-sm-2 control-label">审核状态</label>
                            <div class="i-check col-sm-6" style="line-height: 30px;">
                                <input type="radio" name="status" value="1" <?php if($data['status'] == 1) echo 'checked="checked"'; ?> >&nbsp;待审核&nbsp;
                                <input type="radio" name="status" value="2" <?php if($data['status'] == 2) echo 'checked="checked"'; ?> >&nbsp;已通过&nbsp;
                                <input type="radio" name="status" value="3" <?php if($data['status'] == 3) echo 'checked="checked"'; ?> >&nbsp;不通过&nbsp;
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group reason_class" {if condition="$data['status'] neq 3"}style="display:none;"{/if}>
                        <label class="col-sm-2 control-label">不通过原因</label>
                        <div class="col-sm-6">
                            <textarea name="reason" placeholder="请输入不通过原因" rows="5" class="form-control">{$data['reason']}</textarea>
                            <!-- <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请输入不通过原因</span> -->
                        </div>
                </div>
                <div class="hr-line-dashed reason_class" {if condition="$data['status'] neq 3"}style="display:none;"{/if}></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">证明材料图片</label>
                            <div class="col-sm-6">
                                <div id="file-pretty">
                                    <input type="file" name="image" class="form-control">
                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 温馨提示：图片尺寸建议为：600*600，图片小于4M</span>
                                    <!-- <div class="form-group">
                                        <label class="font-noraml">文件选择（多选）</label>
                                        <input type="file" multiple="multiple" class="form-control">
                                    </div> -->
                                    {if condition="$data['image']"}
                                    <a target="_blank" href="__ROOT__{$data.smallimage}"><i class="fa fa-image fa-2x"></i></a>
                                    <input type="hidden" name="image" value="{$data.smallimage}" />
                                    {/if}

                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <!--<div class="form-group">
                            <label class="col-sm-2 control-label">证明材料图片</label>
                            <div class="col-sm-6">
                                <input type="file" name="image" class="form-control"><br />
                                <div id="image1">
                                    <img src="{$data['smallimage']}"><br /><br/>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>-->

                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="height:auto;">补充说明</label>
                            <div class="col-sm-10">
                                <script type="text/plain" id="editor" name="details" style="width:80%;height:auto;">{$data.details|htmlspecialchars_decode|stripslashes}</script>
                            </div>
                        </div>
                        <!--详情end-->
                        <div class="hr-line-dashed"></div>
                        <input type="hidden" name="id" value="{$data['id']}">
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button id="save" class="btn btn-primary" type="submit">保存</button>
                                <button id="reset" class="btn btn-white" type="submit">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
{include file="Public:footer" /}
<script src="__PUBLIC__/Admin/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
<script type="text/javascript">
    $(function(){
        $('#file-pretty input[type="file"]').prettyFile();
    });
</script>

<script>
    $("#trial_status_group .iCheck-helper").click(function(){
        if($(this).siblings("input").val() == 3){
            $(".reason_class").show();
        }else{
            $(".reason_class").hide();
        }
    });
</script>
    <script>
    function deleteImg1(imagePath,id)
    {
        layer.confirm('确定要图片数据吗',{btn:['确认','取消'], icon:3, closeBtn: 2 },function(index){
            $.ajax({
                url : '__URL__/productImageDel1',
                data : {'path':imagePath,'proId':id},
                type : 'get',
                dataType : 'json',
                //async : false,   //取消同步，执行完之后再往下执行
                success : function(data){
                    if(data.status == 1)
                    {
                        layer.msg(''+data.message+'',{icon:1,time:2000});
                        $("#image1").remove();
                        $("#save").removeAttr('disabled');
                        $("#reset").removeAttr('disabled');
                    }
                }
            });
        });
    }
    function deleteImg2(imagePath,id) {
        layer.confirm('确定要图片数据吗',{btn:['确认','取消'], icon:3, closeBtn: 2 },function(index){
            $.ajax({
                url : '__URL__/productImageDel2',
                data : {'path':imagePath,'proId':id},
                type : 'get',
                dataType : 'json',
                //async : false,   //取消同步，执行完之后再往下执行
                success : function(data){
                    if(data.status == 1)
                    {
                        layer.msg(''+data.message+'',{icon:1,time:2000});
                        $("#image2").remove();
                        $("#save").removeAttr('disabled');
                        $("#reset").removeAttr('disabled');
                    }
                }
            });
        });
    }
</script>





<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>

<script>
    var ue = UE.getEditor('editor');
    // 自定义的编辑器配置项,此处定义的配置项将覆盖editor_config.js中的同名配置
    var editor_a = new baidu.editor.ui.Editor(editorOption);
    editor_a.render('editor');
</script>

<script>
    $(document).ready(function() {
        /**
         * 下面是进行插件初始化
         * 你只需传入相应的键值对
         * */
        $('#defaultForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {/*输入框不同状态，显示图片的样式*/
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {/*验证*/
                prize_name: {/*键名username和input name值对应*/
                    message: '奖品名称验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '奖品名称不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 2,
                            max: 30,
                            message: '奖品名称长度必须在2到30之间'
                        }/*最后一个没有逗号*/
                    }
                },
                prize_num: {/*键名username和input name值对应*/
                    message: '奖品数量验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '奖品数量不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 30,
                            message: '奖品数量长度必须在1到30之间'
                        }/*最后一个没有逗号*/
                    }
                },
                rate: {/*键名username和input name值对应*/
                    message: '中奖概率验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '中奖概率不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 30,
                            message: '中奖概率长度必须在1到30之间'
                        }/*最后一个没有逗号*/
                    }
                },
                max_winning:{/*键名username和input name值对应*/
                    message: '每天最多中奖数量验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '每天最多中奖数量不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 1,
                            max: 30,
                            message: '每天最多中奖数量长度必须在1到30之间'
                        }/*最后一个没有逗号*/
                    }
                }

            }
            // 还有一个比较常用的就是submitHandler属性，它对应着提交按钮的事件方法。
            // submitHandler: function (validator, form, submitButton) {
            //alert("submit");
            /*  var menu_name = $("input[name='menu_name']").val();
             var link = $("input[name='link']").val();
             var ico = $("input[name='ico']").val();
             $.ajax({
             url : '__URL__/addMenu',
             type : 'get',
             data : {'menu_name' : menu_name, 'link' : link, 'ico':ico},
             dataType : 'json',
             success : function(data){
             alert(data.message);
             }
             }); */
            // }
        });
    });

</script>

<script type="text/javascript" src="__PUBLIC__/Admin/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

<script type="text/javascript">
    $('#datetimepicker6').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd HH:ii',
        autoclose:true//日期选择完成后是否关闭选择框
    });
    $('#datetimepicker7').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd HH:ii',
        autoclose:true //Important! See issue #1075
    });

</script>

</body>
</html>
